from rest_framework import serializers
from apitest2.models import Computer, IpAddressUseInfo


class VlanSerializer(serializers.ModelSerializer):
    class Meta:
        model = Computer
        fields = "__all__"

class ComputerSerializer(serializers.ModelSerializer):
    ipaddr = serializers.HyperlinkedIdentityField(view_name='IpUrlView')
    vlan = serializers.CharField()
    class Meta:
        model = Computer
        fields = "__all__"

class IpSerializer(serializers.ModelSerializer):
    class Meta:
        model = IpAddressUseInfo
        fields = "__all__"


